package com.usian.feign;


import com.usian.pojo.Users;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

//获取eureka-provider的调用地址，且具有负载均衡的能力
@FeignClient(value="eureka-provider")
public interface UserFeign {

    @RequestMapping("findAll")
    public List<Users> findAll();

    @RequestMapping("findByname/{nam}")
    public String findByname(@PathVariable String nam);

    @RequestMapping("findBynamea")
    public String findBynamea(@PathVariable String nam);


    @RequestMapping("findById")
    public String findById(@RequestParam Integer id);

    @RequestMapping("findBynameandid/{nam}/{id}")
    public String findBynameandid(@PathVariable String nam,@PathVariable Integer id);

}
